﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using AccessDAL;
using System.Collections.Generic;

namespace web
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            BindMenuNode();
        }

        private void BindMenuNode()
        {
            MenuDAL dal = new MenuDAL();
            List<AccessModel.Menu> lMenu = MenuDAL.QueryMenus();


            for (int i = 0; i < lMenu.Count; i++)
            {
                MenuItem Level1_Node = new MenuItem();
                Level1_Node.Text = lMenu[i].menuname;
                Level1_Node.NavigateUrl = lMenu[i].menulink;
                Level1_Node.Target = "myframe";
                Menu1.Items.Add(Level1_Node);       //添加一级节点
            }


        }
    }
}
